Type Erasure in C++: The Glue between Object-Ori- ented and Generic Programming
نویسنده
چکیده
C++ is a multi-paradigm language. The two main paradigms in C++ are object-oriented programming and generic programming. Many real-world C++ software projects use these two paradigms side by side. This creates considerable tension due to the fact that object-oriented programming is largely based on the judicious choice of types and hierarchies, while generic programming tends to cause an abundance of unrelated types. We show how type erasure can reconcile these conflicting tendencies. We present iterator type erasure as a concrete example that we have implemented and that is being used in production code at Zephyr Associates, Inc..
منابع مشابه
Adapting JML to generic types and Java 1.6
Despite the current effort to implement the Java Modeling Language for Java 1.5, and in particular for generic types, there has been no analysis of the effect of such a transition on JML itself, nor of what language changes should be implemented to take best advantage of the features of current Java. This paper analyzes the interactions between JML and the new features of Java 1.5 and 1.6, and ...
متن کاملGenericity through Constrained Types
Modern object-oriented languages such as X10 require a rich framework for types capable of expressing valuedependency, type-dependency and supporting pluggable, application-specific extensions. In earlier work, we presented the framework of constrained types for concurrent, object-oriented languages, parametrized by an underlying constraint system C . Constraint systems are a very expressive fr...
متن کاملThe Cost of Erasure in Java Generics Type System
Java generics, found in versions 1.5 and later, are implemented by generating only one byte code representation of a generic type or method; a compiler maps all the instantiations of a generic type or method to that unique representation via type erasure. The essence of type erasure is the removal during compilation of all information that is related to type parameters and type arguments. From ...
متن کاملReed-Solomon Erasure Codec Design Using Vivado High-Level Synthesis Application Note (XAPP1273)
This application note focuses on the design of an erasure codec using the Xilinx® Vivado® High-Level Synthesis (HLS) tool, which takes the source code in C programming language and generates highly efficient synthesizable Verilog or VHDL code for a Kintex® UltraScaleTM FPGA. When there is a need to change erasure code parameters, for example, the generator matrix definition or erasure code rate...
متن کاملThe Java 5 generics compromise orthogonality to keep compatibility
In response to a long-lasting anticipation by the Java community, version 1.5 of the Java 2 platform referred to as Java 5 introduced generic types and methods to the Java language. The Java 5 generics are a significant enhancement to the language expressivity because they allow straightforward composition of new generic classes from existing ones while reducing the need for a plethora of type ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2007